#include <iostream>
using namespace std;

bool rec_function(int* arr,int n,int m){
    if(arr[n] != arr[m])
        return false;
    if(n > m)
        return true;
    rec_function(arr,n+1,m-1);
}

int main(){
    int arr[] = {1,2,2,2,1};
    bool r = rec_function(arr,0,sizeof(arr)/sizeof(int)-1);
    cout << r << endl;
    return 1;
}